package com.lzw.breadknife.sample.ui;

import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;

import com.lzw.breadknife.BindLayout;
import com.lzw.breadknife.sample.R;
import com.lzw.breadknife.sample.adapter.MusicAdapter;
import com.lzw.breadknife.sample.bean.Music;

import java.util.ArrayList;
import java.util.List;

/**
 * author  : AWeiLoveAndroid
 * e-mail  : lzw460433675@163.com
 * github  : https://gitee.com/AWeiLoveAndroid/BreadKnife
 * project : BreadKnife
 */
@BindLayout(value = R.layout.activity_recyclerview, rootPackage = "com.lzw.breadknife.sample")
public class RecyclerViewActivity extends BaseActivity<RecyclerViewActivityUnbinder> {
    @Override
    protected int attachTitleRes() {
        return R.string.title_recyclerview;
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        MusicAdapter adapter = new MusicAdapter();
        List<Music> list = new ArrayList<>();
        list.add(new Music("天下","张杰"));
        list.add(new Music("天下","张杰"));
        list.add(new Music("天下","张杰"));
        list.add(new Music("天下","张杰"));
        list.add(new Music("天下","张杰"));
        list.add(new Music("天下","张杰"));
        list.add(new Music("天下","张杰"));
        list.add(new Music("天下","张杰"));
        unBinder.rc_view.setLayoutManager(new LinearLayoutManager(this,LinearLayoutManager.VERTICAL,false));
        unBinder.rc_view.setAdapter(adapter);
        adapter.bindData(list);
    }

    @Override
    protected void onResume() {
        super.onResume();
    }
}
